import { FC } from "react";
import {CheckCircleOutline} from 'antd-mobile-icons'
import style from './index.module.scss'
import { infoType } from "@/store/MessageStore";
import classnames from 'classnames/bind'
const CBN = classnames.bind(style)

type TextMessageType = infoType & {
    position: 'left' | 'right',
}

const TextMessage: FC<TextMessageType> = (props) => {
    const { value, type, position, isSuccess = 'false' } = props
    const TotalCls = {
        'TextMessage': true,
        'left': position === 'left',
        'right': position === 'right',
    }
    return <div className={CBN(TotalCls)}>
        {position === 'left' ? null : isSuccess ? <div className={CBN('issucuss')}>
            <CheckCircleOutline />
        </div> : null}
        {value}
    </div>
}




export default TextMessage